package com.eeepay.eeepay_v2.adapter;

import android.content.Context;
import android.text.TextUtils;

import com.eeepay.eeepay_v2.R;
import com.eeepay.eeepay_v2.model.TradeInfo;
import com.eeepay.v2_library.adapter.ABBaseAdapter;
import com.eeepay.v2_library.adapter.ABViewHolder;

/**
 * Created by Ching on 2016/3/15.
 */
public class TradeDetailsAdapter extends ABBaseAdapter<TradeInfo> {

    public TradeDetailsAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_trade_details_list;
    }

    @Override
    public void convert(ABViewHolder holder, TradeInfo model) {

        if ("金额：".equals(model.getLabel())) {
            holder.setRightTextColor(R.id.lrt_trade_detals_item, R.color.unify_txt_color_black);
        }
        if ("本代理商分润收入：".equals(model.getLabel())) {
            holder.setRightTextColor(R.id.lrt_trade_detals_item, R.color.unify_txt_color_black);
        }
        holder.setLrtText(R.id.lrt_trade_detals_item, model.getLabel(),
                TextUtils.isEmpty(model.getContent()) ? "" : model.getContent());

    }


}
